import org.junit.Test;

import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;

/**
 * Created with IntelliJ IDEA.
 * User: kush
 * Date: 02/08/13
 * Time: 8:20 PM
 * To change this template use File | Settings | File Templates.
 */
public class NumberTest {
    @Test
    public void test_one_has_only_one_ones(){
        assertEquals(1,new Number(1).CountNumberOfOne());
    }

    @Test
    public void test_sorting_of_one_two_gives_one_two(){
        assertArrayEquals(new int [] {1,2}, new Number().sort(new int[] {1,2}));
    }

    @Test
    public void test_sorting_of_two_one_three_gives_one_Two_three(){
        assertArrayEquals(new int [] {1,2,3}, new Number().sort(new int[] {2,1,3}));
    }
    @Test
    public void test_sorting_of_nine_numbers(){
        assertArrayEquals(new int [] {0,1,2,4,8,3,5,6,7}, new Number().sort(new int[] {0,1,2,3,4,5,6,7,8}));
    }

}
